package com.zm;

import com.zm.services.IAcountServices;
import config.SpringConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SpringConfiguration.class)
public class SpringWithJunit {
    //在Junit测试环境下使用SpringIoc容器
    @Resource(name = "AccountServicesImpl")
    private IAcountServices acountServices;


    @Test
    public void spring_junit(){
        acountServices.findAllAccount();
    }

}
